package cn.cheln.explorer.config;

import android.os.Environment;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import cn.cheln.explorer.ds.sdcard.TypeFilter;
import cn.cheln.explorer.ds.uri.NavigationConstants;
import cn.cheln.support.unknown.ComparatorRepo;

public class Constants {

	public static final List<TypeFilter.TextWrapper> excludes = new ArrayList<TypeFilter.TextWrapper>();
	public static TypeFilter.TextWrapper[] HIDDEN_EXCLUDED = null;
	public static String[] HIDDEN_INCLUDED = null;
	public static final String LEWA_HOME = "/LEWA";
    public static String getLewaHome(){
        return Environment.getExternalStorageDirectory()+LEWA_HOME+"/File/apk";
    }
	public static String Thumb_folder = NavigationConstants.SDCARD_PATH
			+ "/LEWA/thumb/file";
	public static final String PRIVACY_HOME = NavigationConstants.SDCARD_PATH
			+ LEWA_HOME + "/.privacy";

	static {
		excludes.add(new TypeFilter.TextWrapper(".thumbnails"));
		excludes.add(new TypeFilter.TextWrapper(".android_secure"));
		excludes.add(new TypeFilter.TextWrapper(".Bluetooth"));
		excludes.add(new TypeFilter.TextWrapper("LOST.DIR"));
		excludes.add(new TypeFilter.TextWrapper("moji"));
		excludes.add(new TypeFilter.TextWrapper("MobileQQ"));
		excludes.add(new TypeFilter.TextWrapper("qihoo_browser"));
		HIDDEN_EXCLUDED = new TypeFilter.TextWrapper[excludes.size()];
		excludes.<TypeFilter.TextWrapper> toArray(HIDDEN_EXCLUDED);

	}
	public static final String LOWERCASE_APK = "apk";
	public static final String LOWERCASE_LWT = "lwt";

	public static final class InvokedPath {

		public static final String ACTION_INSTALL_PATH = "com.lewa.filemgr.install";
		public static final String ACTION_INVOKED_PATH = "com.lewa.filemgr.path_start";
		public static final String ACTION_INVOKED_PATH_EXT = "com.lewa.filemgr.path_start.file_ext";
		public static final String CALLBACK_ACTION = "CALLBACK_ACTION";

	}

	public static final class MULTI_SEND {

		public static final String KEY_LEWA_SEND_FLAG = "com.lewa.filemgr.SEND_FLAG";
		public static final int VALUE_LEWA_SEND_FLAG = 1;
		public static final int VALUE_LEWA_MULTY_SEND_FLAG = 2;
	}

	public static final class OperationContants {

		public static final int FINISH_OPERATION = 0;
		public static final int ICON_LOADED = 1;
		public static final int CHOOSE_TEXT_CHANGED = 2;
		public static final int LOAD_HANDLE = 3;
		public static final int RENAME_FINISH = 4;
		public static final int RENAMING = 5;
		public static final int DIR_REFRESH = 6;
		public static final int SEARCHNOTIFY = 7;
		public static final int SEARCH_NOTIFY_EMPTY = 8;
		public static final int CLEAN_NOTIFY = 9;
		public static final int SHOW_SOFT_INPUT = 10;
		public static final int REFRESH_APKINFO = 11;
		public static final int LOAD_PATHACTIVITY = 12;
		public static final int LOAD_PATHACTIVITY_VIEW = 13;
		public static final int ONINSTALL_REPORT = 14;
		public static final int OTHERS_Show_Input = 15;
		public static final int InviteCommit = 16;
		public static final int askForIFPreserve = 17;
        public static final int RENAMED = 18;
        public static final int BLOW = 19;

        public static final int InputUIPop = 20;
    }

	public static final class CateContants {

		public static final String CATE_MUSIC = "audio";
		public static final String CATE_IMAGES = "image";
		public static final String CATE_VIDEO = "video";
		public static final String CATE_DOCS = "doc";
		public static final String CATE_PACKAGE = "apk";
		public static final String CATE_THEME = "lewa/theme";
		public static final String CATE_FOLDER = "folder";
		public static final int MUSIC_VALUE = 0;
		public static final int IMAGES_VALUE = 1;
		public static final int VIDEO_VALUE = 2;
		public static final int DOCS_VALUE = 3;
		public static final int PACKAGE_VALUE = 4;
		public static final int THEME_VALUE = 5;
		public static final int FOLDER_VALUE = 6;

		public static Map<String, Integer> catMap = new TreeMap<String, Integer>(
				ComparatorRepo.stringKey);
		static {
			catMap.put("audio", MUSIC_VALUE);
			catMap.put("image", IMAGES_VALUE);
			catMap.put("video", VIDEO_VALUE);
			catMap.put("doc", DOCS_VALUE);
			catMap.put("apk", PACKAGE_VALUE);
			catMap.put("lewa/theme", THEME_VALUE);
			catMap.put("folder", FOLDER_VALUE);
		}

	}

	public static final class MIMEContants {

		public static final String MIME_APPLICATION = "application";
		public static final String MIME_TEXT = "text";
	}

	public static final class FieldConstants {

		public static final String PATH = "path";
		public static final String NAME = "name";
		public static final String SIZE = "sizeText";
		public static final String LASTMODIFIED = "lastModified";
		public static final String COUNT = "countStr";
		public static final String ICON_RES = "iconRes";
		public static final String TYPE = "type";
		public static final String UNFORMATTEDSIZE = "unformattedSize";
		public static final String UNFORMATTEDDATE = "unformattedDate";
		public static final String CHECKBOX_OPTION = "isUISelected";

	}

	public static final class ApkInfo {

		public static final String VERSION_NAME = "versionNameStr";
		public static final String VERSION_CONDITION = "versionCondition";
	}

	public static final class MusicInfo {

		public static final String NAME = "name";
		public static final String GENRE = "genre";
		public static final String ALBUM = "album";
		public static final String ALBUMARTIST = "artist";
		public static final String THUMBNAIL = "thumbnail";
		public static final String ARTISTKEY = "artistkey";
		public static final String NAMEKEY = "namekey";
		public static final String LINE = "line";
	}

	public static final class SharedPrefernce {
		public static final String File = "file";
		public static final String RememberedCategory = "ApkRememberedPage";
		public static final String KEY_CATEGORY = "apk";
		public static final String KEY_LWT_ISDELETED = "ISDELETED";
		public static final String SP_IMAGE_FILTER_SIZE = "SP_IMAGE_FILTER_SIZE";
		public static final String KEY_IMAGE_FILTER_SIZE = "KEY_IMAGE_FILTER_SIZE";
		public static final String KEY_USEDCOUNT = "usedcount";
		public static final String Key_Search_Sort = "Key_Search_Sort";
		public static final String KEY_UPDATE_LAODING_PIC = "Key_Pic_Loading";
        public static final String KEY_SORT_SEARCH_POLICY = "KEY_SORT_SEARCH_POLICY";
        public static final String KEY_SORT_SEARCH_SEQ = "KEY_SORT_SEARCH_SEQ";
    }

}
